#include<iostream>
#include<cstdlib>
#include<cstring>
#include<vector>

int merge(std::vector<double> &_arr,int _p,int _q,int _r);
int sort(std::vector<double> &_arr,int _n1,int _n2);

int main (int argc, char *argv[]){
    int n;
    std::cin >> n;
    std::vector<double> arr(n);
    for(std::vector<double>::iterator arr_iterator = arr.begin();
      arr_iterator != arr.end();
      ++arr_iterator)
      std::cin >> *arr_iterator;
    sort(arr,0,arr.size()-1);
    std::cout << "A: ";
    for(std::vector<double>::iterator arr_iterator = arr.begin();
      arr_iterator != arr.end();
      ++arr_iterator)
      std::cout << *arr_iterator << " ";
    std::cout << std::endl;
    return 0;
}

int merge(std::vector<double> &_arr,int _p,int _q,int _r)
{
    double left[_q-_p+1],right[_r-_q];
    for(int i = 0; i+_p<=_q; i++){
        left[i]=_arr[i+_p];
        if(i<_r-_q)
        right[i]=_arr[i+_q+1];
        }
    int i=0,j=0,k=0;
    while(i+_p<=_q&&j<_r-_q){
        if(left[i]<right[j]){
            _arr[_p+k]=left[i];
            k++;i++;
        }
        else{
            _arr[_p+k]=right[j];
            k++;j++;
        }
    }
    for(i;i+_p<=_q;i++)
    {
        _arr[_p+k]=left[i];
        k++;
    }
    for(j;j+_q<_r;j++){
        _arr[_p+k]=right[j];
        k++;
    }
    return 0;
}

int sort(std::vector<double> &_arr,int _n1,int _n2)
{
    if(_n1<_n2){
        int r=(_n1+_n2)/2;
        sort(_arr,_n1,r);
        sort(_arr,r+1,_n2);
        merge(_arr,_n1,r,_n2);
    }
    return 0;
}